package com.cool.mapper.sysmanagemapper;

import com.cool.bo.sysmanage.stuff.LoginSuccessResponseDataBo;
import com.cool.po.sysmanagepo.PermissionPo;
import com.cool.po.sysmanagepo.RolePo;
import com.cool.po.sysmanagepo.StaffPo;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 员工映射器
 *
 * @author Jiangmanman
 * @date 2020/07/31
 */
public interface StaffPoMapper {
    /**
     * delete by primary key
     *
     * @param staffId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer staffId);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(StaffPo record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(StaffPo record);

    /**
     * select by primary key
     *
     * @param staffId primary key
     * @return object by primary key
     */
    StaffPo selectByPrimaryKey(Integer staffId);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(StaffPo record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    Integer updateByPrimaryKey(StaffPo record);

    /**
     * 选择用户名和passwor
     *
     * @param username 用户名
     * @param password 密码
     * @return {@link StaffPo }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    StaffPo selectByUsernameAndPasswor(@Param("username") String username, @Param("password") String password);

    /**
     * 选择所有
     *
     * @param staffPo 员工阿宝
     * @return {@link List<StaffPo> }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    List<StaffPo> selectAllStaffPo(StaffPo staffPo);

    /**
     * 模糊查询
     *
     * @param staffPo 员工阿宝
     * @return {@link PageInfo<StaffPo> }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    PageInfo<StaffPo> fuzzyQuery(StaffPo staffPo);

    /**
     * 由主键更新状态
     *
     * @param state 状态
     * @param id    id
     * @return {@link Integer }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    Integer updateStatusByPrimaryKey(@Param("state") Integer state, @Param("id") Integer id);

    /**
     * 选择所有员工阿宝null
     *
     * @param staffPo 员工阿宝
     * @return {@link List<StaffPo> }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    List<StaffPo> selectAllStaffPoNull(StaffPo staffPo);

    /**
     * 员工id
     *
     * @param staffId 员工id
     * @return {@link List< LoginSuccessResponseDataBo.Menus > }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    List<LoginSuccessResponseDataBo.Menus> selectMsgByStaffId(Integer staffId);

    /**
     * 得到所有权限,角色id
     *
     * @param staffId 员工id
     * @return {@link List<PermissionPo> }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    List<PermissionPo> getAllPermissionByRoleId(Integer staffId);

    /**
     * 选择用户名和密码
     *
     * @param username 用户名
     * @param password 密码
     * @return {@link StaffPo }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    StaffPo selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    /**
     * 查询所有角色
     *
     * @param staffId 员工id
     * @return {@link List<RolePo> }
     * @author Jiangmanman
     * @date 2020/07/31
     */
    List<RolePo> queryAllRoleByStaffId(Integer staffId);
}